// dtree_util.h
// ------------
// Written by Sanmay Das for CS 181, Spring 2000
// Updated by Dan Weiss for CS 181, Spring 2001
// Do NOT modify this file

#ifndef DTREE_UTIL_H
#define DTREE_UTIL_H

#include <cstdio>
#include <cstdlib>

#define MAXLINE 500

// The structure used to describe a dataset.
typedef struct {
  int numattribs; // The number of attributes in the dataset
  int *range;     // the range of attrib i should be 1..range[i]
  int numclasses; // The number of classes
} DatasetDescription;

// The data structure used to represent an instance of a training or
// testing example, specific to the bcw dataset.
// There are 9 attributes, each ranging from 1 to 10 in value. The
// classval is either 0 or 1.
typedef struct {
  int attribs[9]; 
  int classifier;
  // The weight assigned to this example
  float weight;
} inst;

// Functions for validation of command line arguments, parsing input
// from files into arrays of insts, and printing out a dataset contained
// in such an array.
int ValidateInput(int argc, char **argv, int &noisyFlag, 
                  int &pruneFlag, int &valSetSize, int& boostFlag, int& learnerDepth,
                  int &numRounds);
int ParseInput(const DatasetDescription& DD, inst *dataset, int n, FILE *datafile);
void PrintOutput(const DatasetDescription& DD, inst *dataset, int n);

#endif
